package com.starinside.wp.controller.api;

import com.starinside.wp.components.MemVerificationCache;
import com.starinside.wp.domain.ChildrenExtendInfo;
import com.starinside.wp.domain.ChildrenNurseryInfoRecord;
import com.starinside.wp.foundation.constant.RequestConstant;
import com.starinside.wp.foundation.dto.StaffDTO;
import com.starinside.wp.foundation.model.StatusResponse;
import com.starinside.wp.foundation.query.base.PagerQuery;
import com.starinside.wp.service.NurseryInfoRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

;

/**
 * *******************************
 * Created by Tim.
 * form com.matt
 * on 2017/7/19
 * *******************************
 */
@RestController
@RequestMapping("/wx/api/nurseryInfoRecord")
@Api(value = "/wx/api/nurseryInfoRecord", tags = "考勤流水模块")
public class APINurseryInfoRecordController {

    @Autowired
    private NurseryInfoRecordService nurseryInfoRecordService;

    @Autowired
    private MemVerificationCache cache;



    @ApiOperation(value = "获取课时信息")
    @RequestMapping(value = "/getBalance" ,method = RequestMethod.POST)
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "childrenId", value = "学生ID", required = true, dataType = "string"),
            @ApiImplicitParam(paramType = "query", name = "beginDate", value = "开始时间", required = false, dataType = "string"),
            @ApiImplicitParam(paramType = "query", name = "endDate", value = "结束时间", required = false, dataType = "string"),
    })
    public StatusResponse getBalance( @RequestHeader(RequestConstant.TICKET) String ticket,String childrenId, String beginDate, String endDate, PagerQuery pagerQuery) {
        Map  m = nurseryInfoRecordService.getBalance(ticket,childrenId,beginDate,endDate,pagerQuery);
        return StatusResponse.success(m);
    }
}
